﻿@model ESupervision.Models.ForumReply

@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
    ESupervision.Models.ForumTopic forumtopic = ViewBag.ForumTopic;
}

<h2>Details</h2>

<style>
    textarea {
        max-width: 100%;
    }
</style>
<div>
    <h4>ForumTopic</h4>
    <hr />

</div>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h1 class="panel-title" id="panel-title">@forumtopic.ForumTopicTitle<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h1>
    </div>
    <div class="row" style=" padding: 10px 0px 5px 20px;">
        <div class="col-lg-10">
            <label style="color: #2fa4e7; font-size: medium">Posted by:@forumtopic.ForumTopicPoster.FullName</label>
            @forumtopic.ForumTopicPostedTime
        </div>
        <div class="col-lg-2">
            <a href="#">Comment <span class=" panel-title badge">@forumtopic.ForumReplies.Count</span></a> <a href="#"> View <span class=" panel-title badge">@forumtopic.ViewCount</span></a>
        </div>
        <div class="row" style=" padding: 10px 0px 10px 20px;">
            <div class=" col-lg-11">
                <p>@forumtopic.ForumTopicContent</p>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-success">
    <div class="panel-heading">
        <h3 class="panel-title" id="panel-title">List Comment<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
    </div>
    @foreach (var item in forumtopic.ForumReplies)
    {
        <div class="media" style="padding: 10px 30px 10px 30px;">
            <a class="pull-left" href="#">
                <img class="media-object" src="~/Images/UnknownIcon.png" />
            </a>
            <div class="media-body">
                <h4 class="media-heading">
                    @Html.DisplayFor(modelItem => item.ForumReplyPoster.FullName)
                    <small>@Html.DisplayFor(modelItem => item.ForumReplyPostedTime)</small>
                </h4>
                @Html.DisplayFor(modelItem => item.ForumReplyContent)
            </div>
        </div>
    }
</div>

<div class="panel panel-warning">
    <div class="panel-heading">
        <h3 class="panel-title" id="panel-title">Leave a Comment<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
    </div>
    @using (Html.BeginForm("CreateReply", "ForumTopic"))
    {
        @Html.AntiForgeryToken()
        <div class="well">
            <div class="form-group">
                @Html.TextAreaFor(model => model.ForumReplyContent, new { @cols = 300, @rows = 10 })
                @Html.ValidationMessageFor(model => model.ForumReplyContent)
                @Html.HiddenFor(model => model.ForumTopicID)
                @Html.HiddenFor(model => model.ForumReplyPosterID)
            </div>
            <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-pencil">PostComment</span></button>
        </div>
    }
</div>


<p>
    @Html.ActionLink("Back to List", "Index")
</p>
